<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单详情 - 酒店系统</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
    <style>
        body {
            background-color: #f7f9fc;
        }
        .header {
            text-align: center;
            padding: 50px 0;
            background-color: #fff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
        .card {
            border: 1px solid #dcdfe6;
            border-radius: 5px;
            padding: 20px;
            background-color: white;
            margin: 20px 0;
            transition: transform 0.2s;
        }
        .card:hover {
            transform: scale(1.02);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        }
        footer {
            text-align: center;
            padding: 20px 0;
            background-color: #fff;
            box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
        }

        /* 滚动公告style START */
        .announcement-bar {
            overflow: hidden;
            background: #009688;
            color: white;
            padding: 21px 0;
            position: relative;
            width: 100%;
            display: flex;
            align-items: center;
        }

        .announcement-content {
            white-space: nowrap;
            animation: scroll 10s linear infinite;
            position: absolute;
            right: 0;
        }

        @keyframes scroll {
            0% {
                transform: translateX(100%);
            }
            100% {
                transform: translateX(-100%);
            }
        }
        /* 滚动公告style END */

        /* 调整按钮宽度 */
        .btn {
            width: auto; /* 按钮的宽度设置为自动 */
        }
    </style>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
</head>
<body>

<div id="app">
    <div class="announcement-bar">
        <div class="announcement-content">
            <h4 style="font-size: 16px;">欢迎访问我们的酒店展示网站！所有酒店均可在线预约。</h4>
        </div>
    </div>

    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <a class="navbar-brand" href="#">酒店展示</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" href="index.html">首页</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="favorites.html">酒店收藏</a>
                </li>
                <li class="nav-item active">
                    <a class="nav-link" href="#">我的订单 <span class="sr-only">(当前页)</span></a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="profile.html">个人中心</a>
                </li>
            </ul>
        </div>
    </nav>

    <div class="container">
        <div class="row">
            <div class="col-md-6 col-lg-4" v-for="booking in bookings" :key="booking.orderId">
                <div class="card">
                    <h4>酒店名称: {{ booking.hotelName }}</h4>
                    <p><i class="bi bi-geo-alt-fill"></i> 地址: {{ booking.address }}</p>
                    <p>入住日期: {{ booking.checkInDate }}</p>
                    <p>离店日期: {{ booking.checkOutDate }}</p>
                    <p>房间类型: {{ booking.roomType }}</p>
                    <p>订单号: {{ booking.orderId }}</p>
                    <p>付款状态: {{ booking.paymentStatus }}</p>
                    <button class="btn btn-danger" @click="cancelBooking(booking.hotelName)">取消预订</button>
                </div>
            </div>
        </div>
    </div>


</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            bookings: [
                {
                    hotelName: '酒店A',
                    address: '市中心，XX路123号',
                    checkInDate: '2023-10-01',
                    checkOutDate: '2023-10-05',
                    roomType: '豪华单人房',
                    orderId: '123456789',
                    paymentStatus: '已支付'
                },
                // Add more booking objects as needed
                {
                    hotelName: '酒店B',
                    address: '附近，YY路456号',
                    checkInDate: '2023-11-01',
                    checkOutDate: '2023-11-05',
                    roomType: '豪华双人房',
                    orderId: '987654321',
                    paymentStatus: '已支付'
                },
                {
                    hotelName: '酒店C',
                    address: '市中心，ZZ路789号',
                    checkInDate: '2023-12-01',
                    checkOutDate: '2023-12-05',
                    roomType: '家庭房',
                    orderId: '192837465',
                    paymentStatus: '已支付'
                },
            ]
        },
        methods: {
            cancelBooking(hotelName) {
                alert(`您已取消对${hotelName}的预订！`);
            }
        }
    });
</script>

</body>
</html>
